#!/bin/bash

rm -rf build/*
rm -rf target/*
mvn package
mkdir -p build/etc/jetty/contexts/
cp jetty_context.xml build/etc/jetty/contexts/opentcdb.xml
mkdir -p build/usr/share/jetty/webapps/
cp target/*.war build/usr/share/jetty/webapps/
cp -R DEBIAN build/
mkdir -p build/usr/share/doc/opentcdb
cp COPYRIGHT build/usr/share/doc/opentcdb/copyright
fakeroot dpkg -b build/ .
